home *** CD-ROM | disk | FTP | other *** search
- property pIndicatorLowerLimit, pIndicatorRange, pClickedStatus, pCurrentSprite
-
- on beginSprite me
- pCurrentSprite = me.spriteNum
- spacing = 3
- offset = (the height of sprite pCurrentSprite / 2) + spacing
- trackSprite = pCurrentSprite - 1
- trackSpriteTop = the top of sprite trackSprite
- pIndicatorLowerLimit = trackSpriteTop + offset
- trackSpriteBottom = the bottom of sprite trackSprite
- indicatorUpperLimit = trackSpriteBottom - offset
- pIndicatorRange = indicatorUpperLimit - pIndicatorLowerLimit
- set the locV of sprite pCurrentSprite to pIndicatorLowerLimit
- end
-
- on positionIndicator me, textRatio
- currentPosition = pIndicatorRange * textRatio
- indicatorPosition = currentPosition + pIndicatorLowerLimit
- set the locV of sprite pCurrentSprite to indicatorPosition
- end
-
- on mouseDown me
- end
-
- on exitFrame me
- if the mouseDown and (the clickOn = pCurrentSprite) then
- scrollTextWithIndicator(me, the mouseV)
- end if
- end
-
- on scrollTextWithIndicator me, mouseVertical
- nextPosition = mouseVertical
- if nextPosition < pIndicatorLowerLimit then
- nextPosition = pIndicatorLowerLimit
- else
- upperLimit = pIndicatorLowerLimit + pIndicatorRange
- if nextPosition > upperLimit then
- nextPosition = upperLimit
- end if
- end if
- ratioPosition = float(nextPosition - pIndicatorLowerLimit)
- ratio = ratioPosition / pIndicatorRange
- sendAllSprites(#scrollText, ratio)
- end
-
- on getIndicatorPosition me
- return the locV of sprite pCurrentSprite
- end
-